package com.bangbang.controller;


import  com.bangbang.pojo.TbMycourse;
import com.bangbang.service.ITbMycourseService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ${author}
 * @since 2021-08-12
 */
@RestController
@RequestMapping("/bangbang/tbMycourse")
public class TbMycourseController {
    @Autowired
    private ITbMycourseService mycourseService;

    @GetMapping
    @ApiOperation(value = "根据查询所有我的课程")
    @ApiImplicitParams(
            @ApiImplicitParam(name = "userId",value = "用户id",required = true,paramType = "query")
    )
    public List<TbMycourse> selectMyCourse(@RequestParam(required = true) Integer userId){
        List<TbMycourse> byId = mycourseService.selectById(userId);
        return byId;
    }

}

